<?php
use yii\helpers\Html;
use common\components\helpers\Fun;
use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use common\components\extenders\MenuManage;
use common\components\widgets\Datetimepicker;
Datetimepicker::widget(['format'=>'Y-m-d',]);
LayerConfirmWidget::widget();
LayerIframeWidget::widget();
?>
<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height" id="toolbar" data-shelve_url="">
    <div id="search-area" class="yx-bgf7f7f7 yx-radius5 zx-mg yx-function2 yx-pr0">
        <?= Html::beginForm(Fun::url(['mechanicsettlement/index']), 'get', ['enctype' => 'multipart/form-data']) ?>
        <?= \common\components\helpers\Search::textInput('start', $start, ['label'=>'开始时间','class'=>'datetimepicker yx-width150 zx-lh24 yx-ml6']); ?>
        <?= \common\components\helpers\Search::textInput('end', $end, ['label'=>'结束时间','class'=>'datetimepicker yx-width150 zx-lh24 yx-ml6']); ?>
        <?=\common\components\helpers\Search::dropDownList('mechanic_id',\Yii::$app->request->get('mechanic_id'),$mechanicList,['label'=>'选择机构','promote'=>'请选择','class'=>'search diy_select_txt'])?>
        <?=\common\components\helpers\Search::dropDownList('status_id',\Yii::$app->request->get('status_id'),[0=>'未付款',1=>'已付款'],['label'=>'选择状态','promote'=>'请选择','class'=>'search diy_select_txt'])?>
        <?= Html::submitButton('搜索', ['id'=>'search-handle','class'=>"yx-search-new yx-radius2"]); ?>
        <?php Html::endForm() ?>
    </div>
  <div class="docs-main zx-mg">
      <table id="tablesaw" class="tablesaw table yx-table1 yx-table5 table-striped with-check"  >
       <thead>
            <tr class="yx-bgd2f6ec">
                <th><?=\Yii::t('zhtfrontend','机构');?></th>
                <th><?=\Yii::t('zhtfrontend','补贴金额');?></th>
                <th><?=\Yii::t('zhtfrontend','是否付款');?></th>
                <th><?=\Yii::t('zhtfrontend','付款人');?></th>
                <th><?=\Yii::t('zhtfrontend','付款时间');?></th>
                <th><?=\Yii::t('zhtfrontend','操作');?></th>
            </tr>
        </thead>
          <?php if($data):?>
               <?php foreach($data as $item):?>
                  <tr data-id="<?=$item['id']?>">
                      <td><?=$item['mechanic_name']?></td>
                      <td><?=$item['commission_money']?></td>
                      <td><?=$item['status_name']?></td>
                      <td><?=$item['paymant_operator']?></td>
                      <td><?=$item['payment_time']?></td>
                      <td>
                          <?php if($item['status'] == 0) { ?>
                              <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('mechanicsettlement','payment',false,['rel'=>'dialog-show-iframe','class' => 'btn yx-classmagage-about yx-bg89c997 yx-width78 yx-mr5 yx-radius2','data'=>['id'=>$item['id'],'name'=>'确认付款']]);?>
                          <?php }else{ ?>
                              <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('mechanicsettlement','voucher',false,['rel'=>'dialog-show-iframe','class' => 'btn yx-classmagage-about yx-bg89c997 yx-width78 yx-mr5 yx-radius2','data'=>['id'=>$item['id'],'name'=>'添加凭证']]);?>
                          <?php } ?>
                          <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('mechanicsettlement','details',true,['rel'=>'dialog-show-iframe','class' => 'btn yx-classmagage-about yx-bg89c997 yx-width78 yx-mr5 yx-radius2','data'=>['id'=>$item['id'],'name'=>'详情']]);?>

                      </td>
                  </tr>
                <?php endforeach?>
         <?php endif?>
    </table>
      <div style="text-align: right"><?= common\components\widgets\GoPager::widget(['pagination' => $pages]) ?></div>
  </div>
</div>

